/*用户考试信息*/
    var uid = localStorage['MU30-lOGIN-USRNAME'];//获取登录用户
    function queryUser(){
    // IC.talkingDataCount("培训考试","00010");
    //appcan.locStorage.remove(appcan.locStorage.keys());//移除所有的keys
    //发起一个ajax 请求
    var userName=uid,strStartDate="",strEndDate="";
    //将用户名存入本地
    appcan.locStorage.setVal("userName",userName);
    var data={"userName":userName,"strStartDate":strStartDate,"strEndDate":strEndDate};

    //测试地址:
    //var url="http://172.31.64.34:8011/sdk10098/public/yddfMAS/queryUserExams?";

    //uat地址:
    //var url="http://172.31.65.220:8081/sdk10098/public/yddfMAS/queryUserExams?";

    //生产地址:
    // var url="http://store.ceair.com/mas/sdk10098/public/yddfMAS/queryUserExams";
    var url=h_yddfUrl+"yddfMAS/queryUserExams";
    $.ajax({
        type:"get",
        data:data,
        url:url,
        dataType:"json",
        success:function(data){
            appcan.window.closeToast();
            var res=(JSON.parse(data.queryUserExams));
            //console.log(res);
            //请求成功的状态下执行一个方法:
            if(res.status==0){
                //先判断用户是否具有具有考试权限
                // console.log(res.examList);
                if(res.examList.length<=0){
                    appcan.window.confirm("提示","您没有访问权限","确定",function(){
                        appcan.window.openToast("退出中....",2000,5);
                          uexWidget.finishWidget('');
                    })
                    return false;
                }
                $(".main_body").empty();
                //获取考试详细信息:
                //console.log(res);
                var examList=res.examList;
                console.log(examList);
                //遍历考试信息
                for(var i=0;i<examList.length;i++){

                    var user_tite='<div class="ub ub-ac">姓名: '+examList[i].cnName+'</div><div class="ub ub-ac">工号:'+examList[i].employeeNo+'</div><div class="ub ub-ac">部门: '+examList[i].deptName+'</div>';
                    var userId=examList[i].userId;   
                }
                //console.log(examList[i]);                     
                $(".main_body").append(user_tite);
                //获取当前用户的id
               
                //console.log(userId);
                //将用户id 保存到本地
                appcan.locStorage.setVal("userId",userId);
               //请求异常:
            }
            else{
                alert("请求异常");
            }
         },
         error:function(){
           //alert("请求失败");
         }
    })
}
